package de.lulusoft.anothertorrent.gui.views.Providers;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import de.lulusoft.anothertorrent.core.rtorrent.File;

public class FilesTableContentProvider implements PropertyChangeListener,
		IStructuredContentProvider {

	@Override
	public void propertyChange(PropertyChangeEvent arg0) {
	}

	@SuppressWarnings("unchecked")
	@Override
	public Object[] getElements(Object inputElement) {
		if (inputElement instanceof ArrayList)
		{
			return ((ArrayList<File>)inputElement).toArray();
		}
		return null;
	}

	@Override
	public void dispose() {
	}

	@Override
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
	}

}
